<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 取10个随机数存入数组
        var arr = [] ;
        for(var i = 0 ; i < 10 ; i++) {
            arr[i] = parseInt(Math.random() * 100) ;
        }

        console.log(arr);


        // 从10个数里面随机娶一个

        //   取值是通过下标取的   随机取值可以先随机下标，再通过下标取值
        var j = parseInt(Math.random() * arr.length) ;
        var n = arr[j] ;
        console.log(n);

    </script>
    
</body>
</html>